package com.compass.doctor.ui.mine.adapter

import android.view.LayoutInflater
import android.view.ViewGroup
import com.compass.doctor.callback.OnCustomButtonClick
import com.compass.doctor.databinding.LayoutConsultationTypeItemBinding
import com.compass.framework.adapter.BaseBindViewHolder
import com.compass.framework.adapter.BaseRecyclerViewAdapter
import com.compass.framework.model.BusinessProcessing

/**
 * Description： 业务统计adapter
 * Date:2024/2/5 10:09
 */
class BusinessProcessingAdapter : BaseRecyclerViewAdapter<BusinessProcessing, LayoutConsultationTypeItemBinding>() {

    private lateinit var onCustomBottomClick: OnCustomButtonClick

    fun setBottomCallBack(onBottomClick: OnCustomButtonClick) {
        this.onCustomBottomClick = onBottomClick
    }

    override fun getViewBinding(
        layoutInflater: LayoutInflater,
        parent: ViewGroup,
        viewType: Int
    ): LayoutConsultationTypeItemBinding {
        return LayoutConsultationTypeItemBinding.inflate(layoutInflater, parent, false)
    }

    override fun onBindDefViewHolder(
        holder: BaseBindViewHolder<LayoutConsultationTypeItemBinding>,
        item: BusinessProcessing?,
        position: Int
    ) {
        if (item == null) return
        holder.binding.apply {
            tvName.text = item.name
            tvNumber.text = item.count.toString()
        }
    }
}